﻿DECLARE 
  V_NUMBER INTEGER;
   V_SECOUT INTEGER;
BEGIN
   
   select count(*) into V_NUMBER from user_tables where table_name ='HI_TABMODEL';
   IF V_NUMBER = 0 THEN
   EXECUTE IMMEDIATE  'CREATE TABLE HI_TABMODEL('
        || '"TABNAME"  NVARCHAR2 (50) NOT NULL    ,'
 || '"TABRENAME"  NVARCHAR2 (50)   DEFAULT ''''  ,'
 || '"TABDESCRIPT"  NVARCHAR2 (100)   DEFAULT ''''  ,'
 || '"TABSTORETYPE"  INTEGER    DEFAULT 0  ,'
 || '"TABTYPE"  INTEGER    DEFAULT 0  ,'
 || '"TABCACHETYPE"  INTEGER    DEFAULT 0  ,'
 || '"TABSTATUS"  INTEGER    DEFAULT 0  ,'
 || '"ISSYS"  NUMBER(1)     DEFAULT 0  ,'
 || '"ISEDIT"  NUMBER(1)     DEFAULT 0  ,'
 || '"ISLOG"  NUMBER(1)     DEFAULT 0  ,'
 || '"LOGTABLE"  NVARCHAR2 (50)   DEFAULT ''''  ,'
 || '"LOGEXPRIREDAY"  INTEGER    DEFAULT 0  ,'
 || '"CREATETIME"  TIMESTAMP     DEFAULT SYSTIMESTAMP  ,'
 || '"CREATENAME"  NVARCHAR2 (50)   DEFAULT ''''  ,'
 || '"MODITIME"  TIMESTAMP     DEFAULT SYSTIMESTAMP  ,'
 || '"MODINAME"  NVARCHAR2 (50)   DEFAULT ''''  '

   || ') ';
   
    EXECUTE IMMEDIATE 'ALTER TABLE HI_TABMODEL  ADD CONSTRAINT PK_HI_TABMODEL_FC3020417A514A30B206EFF831604FC2 PRIMARY KEY ("TABNAME" )';
   END IF;
   
   select count(*) into V_NUMBER from user_tables where table_name ='HI_FIELDMODEL';
   IF V_NUMBER = 0 THEN
    EXECUTE IMMEDIATE  'CREATE TABLE HI_FIELDMODEL('
    || '"DBNAME"  NVARCHAR2 (50) NOT NULL    ,'
        || '"TABNAME"  NVARCHAR2 (50) NOT NULL    ,'
 || '"FIELDNAME"  NVARCHAR2 (50) NOT NULL    ,'
 || '"FIELDDESC"  NVARCHAR2 (100)   DEFAULT ''''  ,'
 || '"ISIDENTITY"  NUMBER(1)     DEFAULT 0  ,'
 || '"ISPRIMARY"  NUMBER(1)     DEFAULT 0  ,'
 || '"ISBLLKEY"  NUMBER(1)     DEFAULT 0  ,'
 || '"FIELDTYPE"  INTEGER    DEFAULT 0  ,'
 || '"SORTNUM"  INTEGER    DEFAULT 0  ,'
 || '"REGEX"  NVARCHAR2 (200)   DEFAULT ''''  ,'
 || '"DBDEFAULT"  INTEGER    DEFAULT 0  ,'
 || '"DEFAULTVALUE"  NVARCHAR2 (50)   DEFAULT ''''  ,'
 || '"FIELDLEN"  INTEGER    DEFAULT 0  ,'
 || '"FIELDDEC"  INTEGER    DEFAULT 0  ,'
 || '"SNO"  NCHAR (10)  DEFAULT ''''   ,'
 || '"SNO_NUM"  NCHAR (3)  DEFAULT ''''   ,'
 || '"ISSYS"  NUMBER(1)     DEFAULT 0  ,'
 || '"ISNULL"  NUMBER(1)     DEFAULT 0  ,'
 || '"ISREQUIRE"  NUMBER(1)     DEFAULT 0  ,'
 || '"ISIGNORE"  NUMBER(1)     DEFAULT 0  ,'
 || '"ISOBSOLETE"  NUMBER(1)     DEFAULT 0  ,'
 || '"ISSHOW"  NUMBER(1)     DEFAULT 0  ,'
 || '"ISSEARCH"  NUMBER(1)     DEFAULT 0  ,'
 || '"SRCHMODE"  INTEGER    DEFAULT 0  ,'
 || '"ISREFTAB"  NUMBER(1)     DEFAULT 0  ,'
 || '"REFTAB"  NVARCHAR2 (50)   DEFAULT ''''  ,'
 || '"REFFIELD"  NVARCHAR2 (50)   DEFAULT ''''  ,'
 || '"REFFIELDS"  NVARCHAR2 (500)   DEFAULT ''''  ,'
 || '"REFFIELDDESC"  NVARCHAR2 (500)   DEFAULT ''''  ,'
 || '"REFWHERE"  NVARCHAR2 (500)   DEFAULT ''''  ,'
 || '"CREATETIME"  TIMESTAMP     DEFAULT SYSTIMESTAMP  ,'
 || '"CREATENAME"  NVARCHAR2 (50)   DEFAULT ''''  ,'
 || '"MODITIME"  TIMESTAMP     DEFAULT SYSTIMESTAMP  ,'
 || '"MODINAME"  NVARCHAR2 (50)   DEFAULT ''''  '

   || ') ';
   EXECUTE IMMEDIATE 'ALTER TABLE HI_FIELDMODEL  ADD CONSTRAINT PK_HI_FIELDMODEL_23E0AD76BE7D48B0818F1F7A117B23F2 PRIMARY KEY ("DBNAME","TABNAME" ,"FIELDNAME" )';
   
   END IF;
   
   select count(*) into V_NUMBER from user_tables where table_name ='HI_DOMAIN';
   IF V_NUMBER = 0 THEN
    EXECUTE IMMEDIATE  'CREATE TABLE HI_DOMAIN('
        || '"DOMAIN"  NVARCHAR2 (10) NOT NULL    ,'
 || '"DOMAINDESC"  NVARCHAR2 (100)   DEFAULT ''''  ,'
 || '"CREATETIME"  TIMESTAMP     DEFAULT SYSTIMESTAMP  ,'
 || '"CREATENAME"  NVARCHAR2 (50)   DEFAULT ''''  ,'
 || '"MODITIME"  TIMESTAMP     DEFAULT SYSTIMESTAMP  ,'
 || '"MODINAME"  NVARCHAR2 (50)   DEFAULT ''''  '

   || ') ';
   
    EXECUTE IMMEDIATE 'ALTER TABLE HI_DOMAIN  ADD CONSTRAINT PK_HI_DOMAIN_76FAEC023C73474FA477113E355B6EE1 PRIMARY KEY ("DOMAIN" )';
   END IF;
   
   
   select count(*) into V_NUMBER from user_tables where table_name ='HI_DATAELEMENT';
   IF V_NUMBER = 0 THEN
    EXECUTE IMMEDIATE  'CREATE TABLE HI_DATAELEMENT('
        || '"DOMAIN"  NVARCHAR2 (10) NOT NULL    ,'
 || '"ELEMENTVALUE"  NVARCHAR2 (50) NOT NULL    ,'
 || '"ELEMENTDESC"  NVARCHAR2 (100)   DEFAULT ''''  ,'
 || '"SORTNUM"  INTEGER    DEFAULT 0  ,'
 || '"CREATETIME"  TIMESTAMP     DEFAULT SYSTIMESTAMP  ,'
 || '"CREATENAME"  NVARCHAR2 (50)   DEFAULT ''''  ,'
 || '"MODITIME"  TIMESTAMP     DEFAULT SYSTIMESTAMP  ,'
 || '"MODINAME"  NVARCHAR2 (50)   DEFAULT ''''  '

   || ') ';
   
    EXECUTE IMMEDIATE 'ALTER TABLE HI_DATAELEMENT  ADD CONSTRAINT PK_HI_DATAELEMENT_780B5F08535948E984E98ACA993FB667 PRIMARY KEY ("DOMAIN" ,"ELEMENTVALUE" )';
   END IF;
   
   
   
   
    EXECUTE IMMEDIATE 'DELETE FROM HI_TABMODEL WHERE TABNAME=''HI_TABMODEL''';
   EXECUTE IMMEDIATE 'DELETE FROM HI_FIELDMODEL WHERE TABNAME=''HI_TABMODEL''';
   EXECUTE IMMEDIATE 'DELETE FROM HI_TABMODEL WHERE TABNAME=''HI_FIELDMODEL''';
   EXECUTE IMMEDIATE 'DELETE FROM HI_FIELDMODEL WHERE TABNAME=''HI_FIELDMODEL''';
   EXECUTE IMMEDIATE 'DELETE FROM HI_TABMODEL WHERE TABNAME=''HI_DOMAIN''';
   EXECUTE IMMEDIATE 'DELETE FROM HI_FIELDMODEL WHERE TABNAME=''HI_DOMAIN''';
   EXECUTE IMMEDIATE 'DELETE FROM HI_TABMODEL WHERE TABNAME=''HI_DATAELEMENT''';
   EXECUTE IMMEDIATE 'DELETE FROM HI_FIELDMODEL WHERE TABNAME=''HI_DATAELEMENT''';
   
   
   
   
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_TABMODEL ("TABNAME","TABRENAME","TABDESCRIPT","TABSTORETYPE","TABTYPE","TABCACHETYPE","TABSTATUS","ISSYS","ISEDIT","ISLOG","LOGTABLE","LOGEXPRIREDAY") VALUES(''HI_TABMODEL'',''HI_TABMODEL'',''表结构信息主表'',''0'',''0'',''0'',''0'',0,1,0,'''',''0'')';

EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''TABNAME'',''表名'',0,1,1,''11'',''1'','''',''10'','''',''50'',''0'','''','''',1,0,1,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''TABRENAME'',''表的别名'',0,0,0,''11'',''5'','''',''10'','''',''50'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''TABDESCRIPT'',''表描述'',0,0,0,''11'',''5'','''',''10'','''',''100'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''TABSTORETYPE'',''表存储方式'',0,0,0,''21'',''10'','''',''10'','''',''0'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''TABTYPE'',''表类型'',0,0,0,''21'',''15'','''',''10'','''',''0'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''TABCACHETYPE'',''表的缓存类型'',0,0,0,''21'',''20'','''',''10'','''',''0'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''TABSTATUS'',''表状态'',0,0,0,''21'',''25'','''',''10'','''',''0'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''ISSYS'',''是否系统内置表'',0,0,0,''31'',''30'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''ISEDIT'',''是否可编辑'',0,0,0,''31'',''35'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''ISLOG'',''是否开启表日志'',0,0,0,''31'',''40'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''LOGTABLE'',''日志表名'',0,0,0,''11'',''45'','''',''10'','''',''50'',''0'','''','''',1,0,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''LOGEXPRIREDAY'',''日志保留天数'',0,0,0,''21'',''50'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''CREATETIME'',''创建时间'',0,0,0,''41'',''990'','''',''20'','''',''0'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''CREATENAME'',''创建人'',0,0,0,''11'',''991'','''',''10'','''',''50'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''MODITIME'',''修改时间'',0,0,0,''41'',''995'','''',''20'','''',''0'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_TABMODEL'',''MODINAME'',''修改人'',0,0,0,''11'',''998'','''',''10'','''',''50'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
   
   
   
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.TABNAME  IS ''表名''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.TABRENAME  IS ''表的别名''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.TABDESCRIPT  IS ''表描述''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.TABSTORETYPE  IS ''表存储方式''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.TABTYPE  IS ''表类型''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.TABCACHETYPE  IS ''表的缓存类型''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.TABSTATUS  IS ''表状态''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.ISSYS  IS ''是否系统内置表''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.ISEDIT  IS ''是否可编辑''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.ISLOG  IS ''是否开启表日志''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.LOGTABLE  IS ''日志表名''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.LOGEXPRIREDAY  IS ''日志保留天数''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.CREATETIME  IS ''创建时间''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.CREATENAME  IS ''创建人''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.MODITIME  IS ''修改时间''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_TABMODEL.MODINAME  IS ''修改人''';



EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_TABMODEL ("TABNAME","TABRENAME","TABDESCRIPT","TABSTORETYPE","TABTYPE","TABCACHETYPE","TABSTATUS","ISSYS","ISEDIT","ISLOG","LOGTABLE","LOGEXPRIREDAY") VALUES(''HI_FIELDMODEL'',''HI_FIELDMODEL'',''表结构信息字段表'',''0'',''0'',''0'',''0'',0,1,0,'''',''0'')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''DBNAME'',''数据库名'',0,1,1,''11'',''4'','''',''10'','''',''50'',''0'','''','''',1,0,1,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''TABNAME'',''表名'',0,1,1,''11'',''5'','''',''10'','''',''50'',''0'','''','''',1,0,1,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''FIELDNAME'',''字段名'',0,1,1,''11'',''10'','''',''10'','''',''50'',''0'','''','''',1,0,1,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''FIELDDESC'',''字段名描述'',0,0,0,''11'',''15'','''',''10'','''',''100'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''ISIDENTITY'',''是否自增ID'',0,0,0,''31'',''20'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''ISPRIMARY'',''是否主键'',0,0,0,''31'',''25'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''ISBLLKEY'',''是否是业务KEY'',0,0,0,''31'',''30'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''FIELDTYPE'',''字段类型'',0,0,0,''21'',''35'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''SORTNUM'',''字段排序号'',0,0,0,''21'',''40'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''REGEX'',''正则校验表达式'',0,0,0,''11'',''45'','''',''10'','''',''200'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''DBDEFAULT'',''默认值类型'',0,0,0,''21'',''50'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''DEFAULTVALUE'',''默认值'',0,0,0,''11'',''55'','''',''10'','''',''50'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''FIELDLEN'',''字段长度'',0,0,0,''21'',''60'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''FIELDDEC'',''小数点位数'',0,0,0,''21'',''65'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''SNO'',''编号名称'',0,0,0,''13'',''70'','''',''10'','''',''10'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''SNO_NUM'',''子编号'',0,0,0,''13'',''75'','''',''10'','''',''3'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''ISSYS'',''是否系统字段'',0,0,0,''31'',''80'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''ISNULL'',''是否允许NULL'',0,0,0,''31'',''85'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''ISREQUIRE'',''是否必填'',0,0,0,''31'',''90'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''ISIGNORE'',''是否忽略'',0,0,0,''31'',''95'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''ISOBSOLETE'',''是否作废'',0,0,0,''31'',''100'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''ISSHOW'',''是否显示'',0,0,0,''31'',''105'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''ISSEARCH'',''是否允许搜索'',0,0,0,''31'',''110'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''SRCHMODE'',''搜索模式'',0,0,0,''21'',''115'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''ISREFTAB'',''是否引用表'',0,0,0,''31'',''120'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''REFTAB'',''引用表名'',0,0,0,''11'',''125'','''',''10'','''',''50'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''REFFIELD'',''引用的字段'',0,0,0,''11'',''130'','''',''10'','''',''50'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''REFFIELDS'',''引用字段清单'',0,0,0,''11'',''135'','''',''10'','''',''500'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''REFFIELDDESC'',''引用字段清单描述'',0,0,0,''11'',''140'','''',''10'','''',''500'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''REFWHERE'',''引用条件'',0,0,0,''11'',''145'','''',''10'','''',''500'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''CREATETIME'',''创建时间'',0,0,0,''41'',''990'','''',''20'','''',''0'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''CREATENAME'',''创建人'',0,0,0,''11'',''991'','''',''10'','''',''50'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''MODITIME'',''修改时间'',0,0,0,''41'',''995'','''',''20'','''',''0'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_FIELDMODEL'',''MODINAME'',''修改人'',0,0,0,''11'',''998'','''',''10'','''',''50'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';


EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.DBNAME  IS ''数据库名''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.TABNAME  IS ''表名''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.FIELDNAME  IS ''字段名''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.FIELDDESC  IS ''字段名描述''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.ISIDENTITY  IS ''是否自增ID''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.ISPRIMARY  IS ''是否主键''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.ISBLLKEY  IS ''是否是业务KEY''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.FIELDTYPE  IS ''字段类型''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.SORTNUM  IS ''字段排序号''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.REGEX  IS ''正则校验表达式''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.DBDEFAULT  IS ''默认值类型''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.DEFAULTVALUE  IS ''默认值''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.FIELDLEN  IS ''字段长度''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.FIELDDEC  IS ''小数点位数''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.SNO  IS ''编号名称''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.SNO_NUM  IS ''子编号''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.ISSYS  IS ''是否系统字段''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.ISNULL  IS ''是否允许NULL''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.ISREQUIRE  IS ''是否必填''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.ISIGNORE  IS ''是否忽略''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.ISOBSOLETE  IS ''是否作废''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.ISSHOW  IS ''是否显示''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.ISSEARCH  IS ''是否允许搜索''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.SRCHMODE  IS ''搜索模式''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.ISREFTAB  IS ''是否引用表''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.REFTAB  IS ''引用表名''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.REFFIELD  IS ''引用的字段''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.REFFIELDS  IS ''引用字段清单''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.REFFIELDDESC  IS ''引用字段清单描述''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.REFWHERE  IS ''引用条件''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.CREATETIME  IS ''创建时间''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.CREATENAME  IS ''创建人''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.MODITIME  IS ''修改时间''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_FIELDMODEL.MODINAME  IS ''修改人''';


EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_TABMODEL ("TABNAME","TABRENAME","TABDESCRIPT","TABSTORETYPE","TABTYPE","TABCACHETYPE","TABSTATUS","ISSYS","ISEDIT","ISLOG","LOGTABLE","LOGEXPRIREDAY") VALUES(''HI_DOMAIN'',''HI_DOMAIN'',''数据域主表'',''0'',''0'',''0'',''0'',0,1,0,'''',''0'')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DOMAIN'',''DOMAIN'',''数据域名'',0,1,1,''11'',''5'','''',''10'','''',''10'',''0'','''','''',1,0,1,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DOMAIN'',''DOMAINDESC'',''数据域描述'',0,0,0,''11'',''10'','''',''10'','''',''100'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DOMAIN'',''CREATETIME'',''创建时间'',0,0,0,''41'',''990'','''',''20'','''',''0'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DOMAIN'',''CREATENAME'',''创建人'',0,0,0,''11'',''991'','''',''10'','''',''50'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DOMAIN'',''MODITIME'',''修改时间'',0,0,0,''41'',''995'','''',''20'','''',''0'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DOMAIN'',''MODINAME'',''修改人'',0,0,0,''11'',''998'','''',''10'','''',''50'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';

EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DOMAIN.DOMAIN  IS ''数据域名''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DOMAIN.DOMAINDESC  IS ''数据域描述''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DOMAIN.CREATETIME  IS ''创建时间''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DOMAIN.CREATENAME  IS ''创建人''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DOMAIN.MODITIME  IS ''修改时间''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DOMAIN.MODINAME  IS ''修改人''';


EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_TABMODEL ("TABNAME","TABRENAME","TABDESCRIPT","TABSTORETYPE","TABTYPE","TABCACHETYPE","TABSTATUS","ISSYS","ISEDIT","ISLOG","LOGTABLE","LOGEXPRIREDAY") VALUES(''HI_DATAELEMENT'',''HI_DATAELEMENT'',''数据域明细表'',''0'',''0'',''0'',''0'',0,1,0,'''',''0'')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DATAELEMENT'',''DOMAIN'',''数据域名'',0,1,1,''11'',''5'','''',''10'','''',''10'',''0'','''','''',1,0,1,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DATAELEMENT'',''ELEMENTVALUE'',''数据域值'',0,1,1,''11'',''10'','''',''10'','''',''50'',''0'','''','''',1,0,1,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DATAELEMENT'',''ELEMENTDESC'',''数据域值描述'',0,0,0,''11'',''15'','''',''10'','''',''100'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DATAELEMENT'',''SORTNUM'',''数据域排序号'',0,0,0,''21'',''20'','''',''10'','''',''0'',''0'','''','''',1,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DATAELEMENT'',''CREATETIME'',''创建时间'',0,0,0,''41'',''990'','''',''20'','''',''0'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DATAELEMENT'',''CREATENAME'',''创建人'',0,0,0,''11'',''991'','''',''10'','''',''50'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DATAELEMENT'',''MODITIME'',''修改时间'',0,0,0,''41'',''995'','''',''20'','''',''0'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';
EXECUTE IMMEDIATE 'INSERT INTO [$Schema$].HI_FIELDMODEL ("DBNAME","TABNAME","FIELDNAME","FIELDDESC","ISIDENTITY","ISPRIMARY","ISBLLKEY","FIELDTYPE","SORTNUM","REGEX","DBDEFAULT","DEFAULTVALUE","FIELDLEN","FIELDDEC","SNO","SNO_NUM","ISSYS","ISNULL","ISREQUIRE","ISIGNORE","ISOBSOLETE","ISSHOW","ISSEARCH","SRCHMODE","ISREFTAB","REFTAB","REFFIELD","REFFIELDS","REFFIELDDESC","REFWHERE")VALUES('' '',''HI_DATAELEMENT'',''MODINAME'',''修改人'',0,0,0,''11'',''998'','''',''10'','''',''50'',''0'','''','''',0,1,0,0,0,1,1,''10'',0,'''','''','''','''','''')';


EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DATAELEMENT.DOMAIN  IS ''数据域名''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DATAELEMENT.ELEMENTVALUE  IS ''数据域值''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DATAELEMENT.ELEMENTDESC  IS ''数据域值描述''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DATAELEMENT.SORTNUM  IS ''数据域排序号''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DATAELEMENT.CREATETIME  IS ''创建时间''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DATAELEMENT.CREATENAME  IS ''创建人''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DATAELEMENT.MODITIME  IS ''修改时间''';
EXECUTE IMMEDIATE 'COMMENT ON COLUMN HI_DATAELEMENT.MODINAME  IS ''修改人''';


 EXECUTE IMMEDIATE 'UPDATE HI_TABMODEL SET TABSTATUS =1,ISSYS =1 WHERE TABRENAME IN (''HI_TABMODEL'',''HI_FIELDMODEL'',''HI_DOMAIN'',''HI_DATAELEMENT'')';
END;




